home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / odiff.z / odiff
Encoding:
Text File  |  2002-10-03  |  11.3 KB  |  265 lines

  1.  
  2.  
  3.  
  4. OOOODDDDIIIIFFFFFFFF((((1111))))                                                              OOOODDDDIIIIFFFFFFFF((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      odiff - differential file and directory comparator
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ooooddddiiiiffffffff [----llllrrrrssss] [----SSSS_n_a_m_e] [----cccceeeeffffhhhhnnnn] [----xxxx_p_a_t] [----bbbbiiiiwwwwtttt] dir1 dir2
  13.      ooooddddiiiiffffffff [----cccceeeeffffhhhhnnnn] [----bbbbiiiiwwwwtttt] file1 file2
  14.      ooooddddiiiiffffffff [----DDDD_s_t_r_i_n_g] [----bbbbiiiiwwww] file1 file2
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      This used to be the _d_i_f_f command.  The current _d_i_f_f command is a port of
  18.      GNU _d_i_f_f, and is upward compatible with this _o_d_i_f_f.
  19.  
  20.      If both arguments are directories, _o_d_i_f_f sorts the contents of the
  21.      directories by name, and then runs the regular file _o_d_i_f_f algorithm
  22.      (described below) on text files which are different.  Binary files which
  23.      differ, common subdirectories, and files which appear in only one
  24.      directory are listed.  Options when comparing directories are:
  25.  
  26.      ----llll   long output format; each text file _o_d_i_f_f is piped through _p_r(1) to
  27.           paginate it, other differences are remembered and summarized after
  28.           all text file differences are reported.
  29.  
  30.      ----rrrr   causes application of _o_d_i_f_f recursively to common subdirectories
  31.           encountered.
  32.  
  33.      ----ssss   causes _o_d_i_f_f to report files which are the same, which are otherwise
  34.           not mentioned.
  35.  
  36.      ----SSSS_n_a_m_e
  37.           starts a directory _o_d_i_f_f in the middle beginning with file _n_a_m_e.
  38.  
  39.      ----xxxx_p_a_t
  40.           adds _p_a_t to a list of regular expressions.  There can be several
  41.           ----xxxx_p_a_t options.  Any directory or file name matching one of the
  42.           patterns is skipped.  The special characters available in the
  43.           pattern are defined in rrrreeeeggggccccmmmmpppp(3X), and are similar to those used in
  44.           eeeedddd and sssseeeedddd.  For example, the following command will ignore all
  45.           "hidden" files and all RCS archives:
  46.  
  47.                odiff -r '-x^\.' '-x,v$' foo bar
  48.  
  49.  
  50.      When run on regular files, and when comparing text files which differ
  51.      during directory comparison, _o_d_i_f_f tells what lines must be changed in
  52.      the files to bring them into agreement.  Except in rare circumstances,
  53.      _o_d_i_f_f finds a smallest sufficient set of file differences.  If neither
  54.      _f_i_l_e_1 nor _f_i_l_e_2 is a directory, then either may be given as `-', in which
  55.      case the standard input is used.  If _f_i_l_e_1 is a directory, then a file in
  56.      that directory whose file-name is the same as the file-name of _f_i_l_e_2 is
  57.      used (and vice versa).  If both _f_i_l_e_1 and _f_i_l_e_2 are directories, then
  58.      files (or files and directories with ----rrrr) with identical names are
  59.      compared.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. OOOODDDDIIIIFFFFFFFF((((1111))))                                                              OOOODDDDIIIIFFFFFFFF((((1111))))
  71.  
  72.  
  73.  
  74.      There are several options for output format; the default output format
  75.      contains lines of these forms:
  76.  
  77.           _n_1 a _n_3,_n_4
  78.           _n_1,_n_2 d _n_3
  79.           _n_1,_n_2 c _n_3,_n_4
  80.  
  81.      These lines resemble _e_d commands to convert _f_i_l_e_1 into _f_i_l_e_2.  The
  82.      numbers after the letters pertain to _f_i_l_e_2.  In fact, by exchanging `a'
  83.      for `d' and reading backward one may ascertain equally how to convert
  84.      _f_i_l_e_2 into _f_i_l_e_1.  As in _e_d, identical pairs where _n_1 = _n_2 or _n_3 = _n_4 are
  85.      abbreviated as a single number.
  86.  
  87.      Following each of these lines come all the lines that are affected in the
  88.      first file flagged by `<', then all the lines that are affected in the
  89.      second file flagged by `>'.
  90.  
  91.      Except for ----bbbb,,,, ----wwww,,,, ----iiii or ----tttt which may be given with any of the others,
  92.      the following options are mutually exclusive:
  93.  
  94.      ----eeee       produces a script of _a, _c and _d commands for the editor _e_d,
  95.               which will recreate _f_i_l_e_2 from _f_i_l_e_1.  In connection with ----eeee,
  96.               the following shell program may help maintain multiple versions
  97.               of a file.  Only an ancestral file ($1) and a chain of version-
  98.               to-version _e_d scripts ($2,$3,...) made by _o_d_i_f_f need be on hand.
  99.               A `latest version' appears on the standard output.
  100.  
  101.                       (shift; cat $*; echo '1,$p') | ed - $1
  102.  
  103.               Extra commands are added to the output when comparing
  104.               directories with ----eeee,,,, so that the result is a _s_h(1) script for
  105.               converting text files which are common to the two directories
  106.               from their state in _d_i_r_1 to their state in _d_i_r_2.
  107.  
  108.      ----ffff       produces a script similar to that of ----eeee,,,, not useful with _e_d, and
  109.               in the opposite order.
  110.  
  111.      ----nnnn       produces a script similar to that of ----eeee,,,, but in the opposite
  112.               order and with a count of changed lines on each insert or delete
  113.               command.  This is the form used by the RCS commands for storing
  114.               a revision change.
  115.  
  116.      ----cccc       produces a diff with lines of context.  The default is to
  117.               present 3 lines of context and may be changed, e.g to 10, by
  118.               ----cccc11110000.  With ----cccc the output format is modified slightly:  the
  119.               output beginning with identification of the files involved and
  120.               their creation dates and then each change is separated by a line
  121.               with a dozen *'s.  The lines removed from _f_i_l_e_1 are marked with
  122.               `- '; those added to _f_i_l_e_2 are marked `+ '.  Lines which are
  123.               changed from one file to the other are marked in both files with
  124.               `! '.  Changes which lie within <context> lines of each other
  125.               are grouped together on output.  (This is a change from the
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. OOOODDDDIIIIFFFFFFFF((((1111))))                                                              OOOODDDDIIIIFFFFFFFF((((1111))))
  137.  
  138.  
  139.  
  140.               previous ``diff -c'' but the resulting output is usually much
  141.               easier to interpret.)
  142.  
  143.      ----hhhh       does a fast, half-hearted job.  It works only when changed
  144.               stretches are short and well separated, but does work on files
  145.               of unlimited length.
  146.  
  147.      ----DDDDssssttttrrrriiiinnnngggg causes _o_d_i_f_f to create a merged version of _f_i_l_e_1 and _f_i_l_e_2 on
  148.               the standard output, with C preprocessor controls included so
  149.               that a compilation of the result without defining _s_t_r_i_n_g is
  150.               equivalent to compiling _f_i_l_e_1, while defining _s_t_r_i_n_g will yield
  151.               _f_i_l_e_2.
  152.  
  153.      ----bbbb       causes trailing blanks (spaces and tabs) to be ignored, and
  154.               other strings of blanks to compare equal.
  155.  
  156.      ----wwww       is similar to ----bbbb but causes whitespace (blanks and tabs) to be
  157.               totally ignored.  E.g., ``if ( a == b )'' will compare equal to
  158.               ``if(a==b)''.
  159.  
  160.      ----iiii       ignores the case of letters.  E.g., ``A'' will compare equal to
  161.               ``a''.
  162.  
  163.      ----tttt       will expand tabs in output lines.  Normal or ----cccc output adds
  164.               character(s) to the front of each line which may foul up the
  165.               indentation of the original source lines and make the output
  166.               listing difficult to interpret.  This option will preserve the
  167.               original source's indentation.
  168.  
  169. FFFFIIIILLLLEEEESSSS
  170.      /usr/bin/odiff    executable for _o_d_i_f_f.  /bin/diff         executable for
  171.      GNU derived _d_i_f_f.
  172.      /usr/lib/diffh    executable used for the ----hhhh option.
  173.      /tmp/d?????       working files.
  174.      /bin/pr           executed by the ----llll option.
  175.  
  176. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  177.      bdiff(1), cc(1), cmp(1), comm(1), diff(1), diff3(1), ed(1), regcmp(3X)
  178.  
  179. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  180.      Exit status is 0 for no differences, 1 for some differences, 2 for
  181.      trouble.
  182.  
  183. BBBBUUUUGGGGSSSS
  184.      Editing scripts produced under the ----eeee or ----ffff option are naive about
  185.      creating lines consisting of a single `....'.
  186.  
  187.      When comparing directories with the ----bbbb,,,, ----wwww or ----iiii options specified, _o_d_i_f_f
  188.      first compares the files a la _c_m_p(1), and then decides to run the _o_d_i_f_f
  189.      algorithm if they are not equal.  This may cause a small amount of
  190.      spurious output if the files then turn out to be identical because the
  191.      only differences are insignificant blank string or case differences.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. OOOODDDDIIIIFFFFFFFF((((1111))))                                                              OOOODDDDIIIIFFFFFFFF((((1111))))
  203.  
  204.  
  205.  
  206. PPPPEEEERRRRFFFFOOOORRRRMMMMAAAANNNNCCCCEEEE
  207.      The GNU derived _d_i_f_f and older BSD derived _o_d_i_f_f use different
  208.      algorithms.  If the two files to be compared fit in main memory, then
  209.      _d_i_f_f is faster, but if they don't fit, _d_i_f_f can cause severe paging.  The
  210.      _o_d_i_f_f algorithm uses a small, fixed amount of memory even on large files.
  211.      The multiple pass algorithm of _o_d_i_f_f is up to two or three times slower
  212.      than _d_i_f_f, on files that fit in memory, but can be many times faster on
  213.      files that don't fit.
  214.  
  215.      The _d_i_f_f command automatically invokes the _o_d_i_f_f (searching for _o_d_i_f_f
  216.      along $$$$PPPPAAAATTTTHHHH) on files that have a combined size larger than one-fourth of
  217.      memory size, if no GNU specific _d_i_f_f options were specified.  If that
  218.      fails, then _d_i_f_f attempts the work itself.
  219.  
  220.      You can force either variant: specifying -_H always gets _d_i_f_f, specifying
  221.      _o_d_i_f_f always gets _o_d_i_f_f.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.